
#include <BOpenGL>
#include <BRender>
#include "member_BViewer.h"
#include "member_BControl.h"

using namespace BWE;

member_BViewer::member_BViewer(BViewer* viewer)
{
	boss = viewer;
}
member_BViewer::~member_BViewer()
{

}

void member_BViewer::paintControl(BControl* control, BPainter& painter)
{
	if (!control || !control->able())
		return;
	control_member(control)->paint(painter);
	for (int i = 0; i < control_member(control)->slaves.size(); i++)
	{
		BControl* slave = control_member(control)->slaves[i];
		paintControl(slave, painter);
	}
}
void member_BViewer::freshControl(BControl* control, const BEvent& event)
{
	if (!control || !control->able())
		return;
	control_member(control)->fresh(event);
	for (int i = 0; i < control_member(control)->slaves.size(); i++)
	{
		BControl* slave = control_member(control)->slaves[i];
		freshControl(slave, event);
	}
}
